<ui:composition template="/admin/templates/ui2.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:composite="http://java.sun.com/jsf/composite/primefaces"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"
    xmlns:o="http://omnifaces.org/ui"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions"
    xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:define name="content">
    	<div class="entry">
    	<p:toolbar styleClass="admin-nav-toolbar">
            <p:toolbarGroup>
                <h:outputLabel value="#{commonMsg.currentPositionLabel} #{userMsg.modifyPwd}"></h:outputLabel>
            </p:toolbarGroup>
            
        </p:toolbar>
        <p:spacer></p:spacer> 
	       <h:form id="form">
	           
					<o:validateEqual components="password repwd" message="两次输入密码不一致"></o:validateEqual>	               
	           <h:panelGrid columns="2"  columnClasses="col1,col2" id="panel">
	               <h:outputLabel value="#{userMsg.oldPwd}"></h:outputLabel>
	               <h:inputSecret value="#{userHome.oldPassword}" 
	                   required="true" label="#{commonMsg.IDLabel}" requiredMessage="#{userMsg.oldPwdMustBeInput}"></h:inputSecret>
	               
	               <h:outputLabel value="#{userMsg.newPwd}"></h:outputLabel>
	               <h:inputSecret id="password" required="true" label="#{userMsg.newPwd}"
	                   value="#{userHome.instance.password}" validatorMessage="#{userMsg.newPwdNotMatchTheRole}">
	                   <f:validateRegex pattern="^[a-zA-Z0-9_]+$"></f:validateRegex>
	                   <f:validateLength minimum="6"></f:validateLength>
	               </h:inputSecret>
	               
	               <h:outputLabel value="#{userMsg.preNewPwd}"></h:outputLabel>
                   <h:inputSecret id="repwd" required="true" label="#{userMsg.preNewPwd}">
                       <f:validateLength minimum="6"></f:validateLength>
                   </h:inputSecret>
	               <h:outputLabel value="#{userMsg.prompt}"></h:outputLabel>
	               <h:outputText value="#{userMsg.pwdRole}"></h:outputText>
	               <h:outputLabel value="#{commonMsg.actionLabel}"></h:outputLabel>
	               <ui:fragment>
					<p:commandButton actionListener="#{userHome.modifyPassword}" update="@form"
						value="#{commonMsg.saveLabel}" id="saveBtn"></p:commandButton>
					<p:commandButton type="reset" value="#{commonMsg.resetLabel}"></p:commandButton>
	                   <p:blockUI block="panel" trigger="saveBtn"></p:blockUI>
	               </ui:fragment>
	               
	           </h:panelGrid>
	       </h:form>
	     </div>
    </ui:define>	
</ui:composition>
